package com.itheima.d14_api_Integer;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        Integer a2 = Integer.valueOf(12);
        System.out.println(a2);

        Integer a3 = 12;

        int a4 = a3;

        ArrayList<Integer> list = new ArrayList<>();
        list.add(12);
        list.add(13);

        int rs = list.get(0);

        System.out.println("-----");

        Integer a5 = 127;
        String rs1 = Integer.toString(a5);// 转成字符串
        System.out.println(rs1 + 1);// 1271

        String rs2 = a5.toString();// 转成字符串
        System.out.println(rs2 + 1);

        String rs3 = a5 + "1";// 1271
        System.out.println(rs3);

        System.out.println("-----");

        //把字符串转换成基本数据类型
        String ageStr = "29";
        int age = Integer.valueOf(ageStr);
        System.out.println(age + 1);

        String scoreStr = "90.5";
        double score = Double.valueOf(scoreStr);
        System.out.println(score + 0.5);


    }
}
